<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String pageUrl = request.getParameter("pageUrl");
	String pageParam = request.getParameter("pageParam");
%>
<a href="<%=pageUrl%>?page=1&rows=${result.pageSize}&<%=pageParam%>">首页</a>
<!-- 上一页 -->
<c:choose>
	<c:when test="${result.hasPreviousPage}">
		<a href="<%=pageUrl%>?page=${result.prePage}&rows=${result.pageSize}&<%=pageParam%>">上一页</a>
	</c:when>
	<c:otherwise>上一页</c:otherwise>
</c:choose>

<!-- 页数列表 -->
<c:forEach items="${result.navigatepageNums}" var="i">
	<c:choose>
		<c:when test="${i == result.pageNum}">${i}</c:when>
		<c:otherwise>
			<a href="<%=pageUrl%>?page=${i}&rows=${result.pageSize}&<%=pageParam%>">${i}</a>
		</c:otherwise>
	</c:choose>
</c:forEach>
<!-- 下一页 -->
<c:choose>
	<c:when test="${result.hasNextPage}">
		<a href="<%=pageUrl%>?page=${result.nextPage}&rows=${result.pageSize}&<%=pageParam%>">下一页</a>
	</c:when>
	<c:otherwise>下一页</c:otherwise>
</c:choose>
<!-- 末页 -->
<c:choose>
	<c:when test="${!result.isLastPage}">
		<a href="<%=pageUrl%>?page=${result.navigateLastPage}&rows=${result.pageSize}&<%=pageParam%>">末页</a>
	</c:when>
	<c:otherwise>末页</c:otherwise>
</c:choose>
<!-- 跳转 -->
<a href="#" id="toPage">跳转到</a><input type="text" name = "page" value="${result.pageNum}" size="5">
&nbsp;&nbsp;共${result.total}条记录&nbsp;&nbsp;当前是${result.pageNum}/${result.pages}页

<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/jquery-3.2.1.js"></script>
<script type="text/javascript">
	$(function(){
		$("#toPage").click(function(){			
			var page = $("input[name=page]").val();	
			location.href = "<%=pageUrl%>?page="+page+"&rows=${result.pageSize}&<%=pageParam%>";
			return false;
			
		})
	})
</script>